﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate.Mappings;

namespace Apollo
{
    [NHibernateEntity(Table = "Positions", Lazy = true)]
    public class Position : ILegacy
    {
        public Position() { }

        [PrimaryKey]
        public virtual int Id { get; set; }

        [Property]
        public virtual string Name { get; set; }

        [Property]
        public virtual string Code { get; set; }

        [Property]
        public virtual string Description { get; set; }

        [BelongsTo(Column = "ID_Parent_Position")]
        public virtual Position Parent { get; set; }

        [Property]
        public virtual int Lo { get; set; }

        [Property]
        public virtual int Hi { get; set; }

        [Property]
        public virtual string LegacyApplication { get; set; }

        [Property]
        public virtual string LegacyID { get; set; }

        [Property]
        public virtual bool IsTeam { get; set; }

        [Property]
        public virtual State State { get; set; }

        [Property]
        public virtual string CostCenter { get; set; }

        [ReadOnly]
        [BelongsTo(Column = "ID_Region_Position", Insert = false, Update = false)]
        public virtual Position Region { get; set; }

        [ReadOnly]
        [BelongsTo(Column = "ID_Agency_Position", Insert = false, Update = false)]
        public virtual Position Agency { get; set; }
    }
}
